package com.xuecheng.framework.exception;

import com.xuecheng.framework.model.response.ResultCode;

/**
 * 自定义异常类
 * @author zhaoxiang
 * @version 1.0
 * @Date 2019/9/25 21:23
 */
public class CustomException extends RuntimeException {

    //错误代码
    private ResultCode resultCode;

    public CustomException(ResultCode resultCode){
        //异常信息为：错误代码+异常信息
        super();
        this.resultCode = resultCode;
    }

    //设置get方法获取异常信息
    public ResultCode getCustomException(){
        return resultCode;
    }
}
